/**
 * MyColor.cpp
 *
 * Author:
 *   Chris Herbison
 *
 * Description:
 *   Class that holds float values for red, green, and blue values of a color.
 */

#include "MyColor.h"

/*
 * Constructor for MyColor class.
 *
 * red - Red component of color.
 * blue - Blue component of color.
 * green - Green component of color.
 * alpha - How translucent the color is (not relevant).
 */
MyColor::MyColor(double red, double green, double blue, double alpha):r(red), g(green), b(blue), a(alpha){
}

/*
 * Copy constructor for MyColor class.
 *
 * c2 - The MyColor to copy from.
 */
MyColor::MyColor(const MyColor& c2){
     r = c2.r;
     b = c2.b;
     g = c2.g;
     a = c2.a;
}

/*
 * Default constructor.
 */
MyColor::MyColor(){
}

/*
 * Sets this color equal to another color.
 *
 * c2 - The color to copy from.
 */
MyColor& MyColor::operator=(const MyColor& c2){
     r = c2.r;
     b = c2.b;
     g = c2.g;
     a = c2.a;
	 return *this;
}

MyColor& MyColor::operator+=(const MyColor& c2){
	r += c2.r;
	g += c2.g;
	b += c2.b;
	return *this;
}

MyColor& MyColor::operator*(const MyColor& c2){
	r *= c2.r;
	g *= c2.g;
	b *= c2.b;
	a *= c2.a;
	return *this;
}

MyColor& MyColor::operator*(double s){
	r *= s;
	g *= s;
	b *= s;
	return *this;
}

MyColor& MyColor::operator/(double s){
	r /= s;
	g /= s;
	b /= s;
	return *this;
}